<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>VariantSupport (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="VariantSupport (POI API Documentation)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/VariantSupport.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/poi/hpsf/Variant.html" title="class in org.apache.poi.hpsf"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../org/apache/poi/hpsf/VariantTypeException.html" title="class in org.apache.poi.hpsf"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/poi/hpsf/VariantSupport.html" target="_top">FRAMES</a></li>
<li><a href="VariantSupport.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li><a href="#field_summary">FIELD</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li><a href="#field_detail">FIELD</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<p class="subTitle">org.apache.poi.hpsf</p>
<h2 title="Class VariantSupport" class="title">Class VariantSupport</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../org/apache/poi/hpsf/Variant.html" title="class in org.apache.poi.hpsf">org.apache.poi.hpsf.Variant</a></li>
<li>
<ul class="inheritance">
<li>org.apache.poi.hpsf.VariantSupport</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <strong>VariantSupport</strong>
extends <a href="../../../../org/apache/poi/hpsf/Variant.html" title="class in org.apache.poi.hpsf">Variant</a></pre>
<div class="block"><p>Supports reading and writing of variant data.</p>

 <p><strong>FIXME (3):</strong> Reading and writing should be made more
 uniform than it is now. The following items should be resolved:

 <ul>

 <li><p>Reading requires a length parameter that is 4 byte greater than the
 actual data, because the variant type field is included. </p></li>

 <li><p>Reading reads from a byte array while writing writes to an byte array
 output stream.</p></li>

 </ul></div>
<dl><dt><span class="strong">Author:</span></dt>
  <dd>Rainer Klute <a
 href="mailto:klute@rainer-klute.de">&lt;klute@rainer-klute.de&gt;</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int[]</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/poi/hpsf/VariantSupport.html#SUPPORTED_TYPES">SUPPORTED_TYPES</a></strong></code>
<div class="block">HPSF is able to read these <a href="../../../../org/apache/poi/hpsf/Variant.html" title="class in org.apache.poi.hpsf"><code>Variant</code></a> types.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static java.util.List&lt;java.lang.Long&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/poi/hpsf/VariantSupport.html#unsupportedMessage">unsupportedMessage</a></strong></code>
<div class="block">Keeps a list of the variant types an "unsupported" message has already
 been issued for.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.poi.hpsf.Variant">
<!--   -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.poi.hpsf.<a href="../../../../org/apache/poi/hpsf/Variant.html" title="class in org.apache.poi.hpsf">Variant</a></h3>
<code><a href="../../../../org/apache/poi/hpsf/Variant.html#LENGTH_0">LENGTH_0</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#LENGTH_2">LENGTH_2</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#LENGTH_4">LENGTH_4</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#LENGTH_8">LENGTH_8</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#LENGTH_UNKNOWN">LENGTH_UNKNOWN</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#LENGTH_VARIABLE">LENGTH_VARIABLE</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_ARRAY">VT_ARRAY</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_BLOB">VT_BLOB</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_BLOB_OBJECT">VT_BLOB_OBJECT</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_BOOL">VT_BOOL</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_BSTR">VT_BSTR</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_BYREF">VT_BYREF</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_CARRAY">VT_CARRAY</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_CF">VT_CF</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_CLSID">VT_CLSID</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_CY">VT_CY</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_DATE">VT_DATE</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_DECIMAL">VT_DECIMAL</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_DISPATCH">VT_DISPATCH</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_EMPTY">VT_EMPTY</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_ERROR">VT_ERROR</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_FILETIME">VT_FILETIME</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_HRESULT">VT_HRESULT</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_I1">VT_I1</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_I2">VT_I2</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_I4">VT_I4</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_I8">VT_I8</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_ILLEGAL">VT_ILLEGAL</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_ILLEGALMASKED">VT_ILLEGALMASKED</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_INT">VT_INT</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_LPSTR">VT_LPSTR</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_LPWSTR">VT_LPWSTR</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_NULL">VT_NULL</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_PTR">VT_PTR</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_R4">VT_R4</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_R8">VT_R8</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_RESERVED">VT_RESERVED</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_SAFEARRAY">VT_SAFEARRAY</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_STORAGE">VT_STORAGE</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_STORED_OBJECT">VT_STORED_OBJECT</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_STREAM">VT_STREAM</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_STREAMED_OBJECT">VT_STREAMED_OBJECT</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_TYPEMASK">VT_TYPEMASK</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_UI1">VT_UI1</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_UI2">VT_UI2</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_UI4">VT_UI4</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_UI8">VT_UI8</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_UINT">VT_UINT</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_UNKNOWN">VT_UNKNOWN</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_USERDEFINED">VT_USERDEFINED</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_VARIANT">VT_VARIANT</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_VECTOR">VT_VECTOR</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_VERSIONED_STREAM">VT_VERSIONED_STREAM</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_VOID">VT_VOID</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/poi/hpsf/VariantSupport.html#VariantSupport()">VariantSupport</a></strong>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/poi/hpsf/VariantSupport.html#codepageToEncoding(int)">codepageToEncoding</a></strong>(int&nbsp;codepage)</code>
<div class="block">Turns a codepage number into the equivalent character encoding's
 name.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/poi/hpsf/VariantSupport.html#isLogUnsupportedTypes()">isLogUnsupportedTypes</a></strong>()</code>
<div class="block">Checks whether logging of unsupported variant types warning is turned
 on or off.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/poi/hpsf/VariantSupport.html#isSupportedType(int)">isSupportedType</a></strong>(int&nbsp;variantType)</code>
<div class="block">Checks whether HPSF supports the specified variant type.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/poi/hpsf/VariantSupport.html#read(byte[], int, int, long, int)">read</a></strong>(byte[]&nbsp;src,
    int&nbsp;offset,
    int&nbsp;length,
    long&nbsp;type,
    int&nbsp;codepage)</code>
<div class="block">Reads a variant type from a byte array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/poi/hpsf/VariantSupport.html#setLogUnsupportedTypes(boolean)">setLogUnsupportedTypes</a></strong>(boolean&nbsp;logUnsupportedTypes)</code>
<div class="block">Specifies whether warnings about unsupported variant types are to be
 written to <code>System.err</code> or not.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/poi/hpsf/VariantSupport.html#write(java.io.OutputStream, long, java.lang.Object, int)">write</a></strong>(java.io.OutputStream&nbsp;out,
     long&nbsp;type,
     java.lang.Object&nbsp;value,
     int&nbsp;codepage)</code>
<div class="block">Writes a variant value to an output stream.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/poi/hpsf/VariantSupport.html#writeUnsupportedTypeMessage(org.apache.poi.hpsf.UnsupportedVariantTypeException)">writeUnsupportedTypeMessage</a></strong>(<a href="../../../../org/apache/poi/hpsf/UnsupportedVariantTypeException.html" title="class in org.apache.poi.hpsf">UnsupportedVariantTypeException</a>&nbsp;ex)</code>
<div class="block">Writes a warning to <code>System.err</code> that a variant type is
 unsupported by HPSF.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.poi.hpsf.Variant">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.poi.hpsf.<a href="../../../../org/apache/poi/hpsf/Variant.html" title="class in org.apache.poi.hpsf">Variant</a></h3>
<code><a href="../../../../org/apache/poi/hpsf/Variant.html#getVariantLength(long)">getVariantLength</a>, <a href="../../../../org/apache/poi/hpsf/Variant.html#getVariantName(long)">getVariantName</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="unsupportedMessage">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unsupportedMessage</h4>
<pre>protected static&nbsp;java.util.List&lt;java.lang.Long&gt; unsupportedMessage</pre>
<div class="block"><p>Keeps a list of the variant types an "unsupported" message has already
 been issued for.</p></div>
</li>
</ul>
<a name="SUPPORTED_TYPES">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SUPPORTED_TYPES</h4>
<pre>public static final&nbsp;int[] SUPPORTED_TYPES</pre>
<div class="block"><p>HPSF is able to read these <a href="../../../../org/apache/poi/hpsf/Variant.html" title="class in org.apache.poi.hpsf"><code>Variant</code></a> types.</p></div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="VariantSupport()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>VariantSupport</h4>
<pre>public&nbsp;VariantSupport()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="setLogUnsupportedTypes(boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setLogUnsupportedTypes</h4>
<pre>public static&nbsp;void&nbsp;setLogUnsupportedTypes(boolean&nbsp;logUnsupportedTypes)</pre>
<div class="block"><p>Specifies whether warnings about unsupported variant types are to be
 written to <code>System.err</code> or not.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>logUnsupportedTypes</code> - If <code>true</code> warnings will be written,
 if <code>false</code> they won't.</dd></dl>
</li>
</ul>
<a name="isLogUnsupportedTypes()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isLogUnsupportedTypes</h4>
<pre>public static&nbsp;boolean&nbsp;isLogUnsupportedTypes()</pre>
<div class="block"><p>Checks whether logging of unsupported variant types warning is turned
 on or off.</p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd><code>true</code> if logging is turned on, else
 <code>false</code>.</dd></dl>
</li>
</ul>
<a name="writeUnsupportedTypeMessage(org.apache.poi.hpsf.UnsupportedVariantTypeException)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeUnsupportedTypeMessage</h4>
<pre>protected static&nbsp;void&nbsp;writeUnsupportedTypeMessage(<a href="../../../../org/apache/poi/hpsf/UnsupportedVariantTypeException.html" title="class in org.apache.poi.hpsf">UnsupportedVariantTypeException</a>&nbsp;ex)</pre>
<div class="block"><p>Writes a warning to <code>System.err</code> that a variant type is
 unsupported by HPSF. Such a warning is written only once for each variant
 type. Log messages can be turned on or off by </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>ex</code> - The exception to log</dd></dl>
</li>
</ul>
<a name="isSupportedType(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSupportedType</h4>
<pre>public&nbsp;boolean&nbsp;isSupportedType(int&nbsp;variantType)</pre>
<div class="block"><p>Checks whether HPSF supports the specified variant type. Unsupported
 types should be implemented included in the <a href="../../../../org/apache/poi/hpsf/VariantSupport.html#SUPPORTED_TYPES"><code>SUPPORTED_TYPES</code></a>
 array.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>variantType</code> - the variant type to check</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if HPFS supports this type, else
         <code>false</code></dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/poi/hpsf/Variant.html" title="class in org.apache.poi.hpsf"><code>Variant</code></a></dd></dl>
</li>
</ul>
<a name="read(byte[], int, int, long, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>read</h4>
<pre>public static&nbsp;java.lang.Object&nbsp;read(byte[]&nbsp;src,
                    int&nbsp;offset,
                    int&nbsp;length,
                    long&nbsp;type,
                    int&nbsp;codepage)
                             throws <a href="../../../../org/apache/poi/hpsf/ReadingNotSupportedException.html" title="class in org.apache.poi.hpsf">ReadingNotSupportedException</a>,
                                    java.io.UnsupportedEncodingException</pre>
<div class="block"><p>Reads a variant type from a byte array.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>src</code> - The byte array</dd><dd><code>offset</code> - The offset in the byte array where the variant starts</dd><dd><code>length</code> - The length of the variant including the variant type field</dd><dd><code>type</code> - The variant type to read</dd><dd><code>codepage</code> - The codepage to use for non-wide strings</dd>
<dt><span class="strong">Returns:</span></dt><dd>A Java object that corresponds best to the variant field. For
         example, a VT_I4 is returned as a <code>Long</code>, a VT_LPSTR as a
         <code>String</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/poi/hpsf/ReadingNotSupportedException.html" title="class in org.apache.poi.hpsf">ReadingNotSupportedException</a></code> - if a property is to be written
            who's variant type HPSF does not yet support</dd>
<dd><code>java.io.UnsupportedEncodingException</code> - if the specified codepage is not
            supported.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/poi/hpsf/Variant.html" title="class in org.apache.poi.hpsf"><code>Variant</code></a></dd></dl>
</li>
</ul>
<a name="codepageToEncoding(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>codepageToEncoding</h4>
<pre>public static&nbsp;java.lang.String&nbsp;codepageToEncoding(int&nbsp;codepage)
                                           throws java.io.UnsupportedEncodingException</pre>
<div class="block"><p>Turns a codepage number into the equivalent character encoding's
 name.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>codepage</code> - The codepage number</dd>
<dt><span class="strong">Returns:</span></dt><dd>The character encoding's name. If the codepage number is 65001,
 the encoding name is "UTF-8". All other positive numbers are mapped to
 "cp" followed by the number, e.g. if the codepage number is 1252 the
 returned character encoding name will be "cp1252".</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.UnsupportedEncodingException</code> - if the specified codepage is
 less than zero.</dd></dl>
</li>
</ul>
<a name="write(java.io.OutputStream, long, java.lang.Object, int)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>write</h4>
<pre>public static&nbsp;int&nbsp;write(java.io.OutputStream&nbsp;out,
        long&nbsp;type,
        java.lang.Object&nbsp;value,
        int&nbsp;codepage)
                 throws java.io.IOException,
                        <a href="../../../../org/apache/poi/hpsf/WritingNotSupportedException.html" title="class in org.apache.poi.hpsf">WritingNotSupportedException</a></pre>
<div class="block"><p>Writes a variant value to an output stream. This method ensures that
 always a multiple of 4 bytes is written.</p>

 <p>If the codepage is UTF-16, which is encouraged, strings
 <strong>must</strong> always be written as <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_LPWSTR"><code>Variant.VT_LPWSTR</code></a>
 strings, not as <a href="../../../../org/apache/poi/hpsf/Variant.html#VT_LPSTR"><code>Variant.VT_LPSTR</code></a> strings. This method ensure this
 by converting strings appropriately, if needed.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>out</code> - The stream to write the value to.</dd><dd><code>type</code> - The variant's type.</dd><dd><code>value</code> - The variant's value.</dd><dd><code>codepage</code> - The codepage to use to write non-wide strings</dd>
<dt><span class="strong">Returns:</span></dt><dd>The number of entities that have been written. In many cases an
 "entity" is a byte but this is not always the case.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if an I/O exceptions occurs</dd>
<dd><code><a href="../../../../org/apache/poi/hpsf/WritingNotSupportedException.html" title="class in org.apache.poi.hpsf">WritingNotSupportedException</a></code> - if a property is to be written
 who's variant type HPSF does not yet support</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/VariantSupport.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/poi/hpsf/Variant.html" title="class in org.apache.poi.hpsf"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../org/apache/poi/hpsf/VariantTypeException.html" title="class in org.apache.poi.hpsf"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/poi/hpsf/VariantSupport.html" target="_top">FRAMES</a></li>
<li><a href="VariantSupport.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li><a href="#field_summary">FIELD</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li><a href="#field_detail">FIELD</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
                <i>Copyright 2014 The Apache Software Foundation or
        its licensors, as applicable.</i>
            </small></p>
</body>
</html>
